<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" isELIgnored="false"%>

<%
	request.setAttribute("modelConfigPath", "shop");
%>

<%@ include file="/WEB-INF/views/shared/master/contentHeader.jsp"%>
<style type="text/css">


</style>
<t:panel cssClass="panel-flat form-detailed" customBody="true" customHead="true">
    <div class="detailed-navbar-content panel-body">
        <t:form modelAttribute="customerRecord" action="/shop/customerRecord/save" method="post" cssClass="form-horizontal">
            <div class="hide">
                 <t:hidden path="recordId"/>
                 <t:hidden path="customerId"/>
                 <t:hidden path="deleteMark"/>
 				 <t:hidden path="createUserName"/>
		 		 <t:hidden path="createUserId"/>
		 		 <t:hidden path="createDate"/>
		 		 <t:hidden path="shopId"/>
		 		 <t:hidden path="type"/>
            </div>
            
            <t:formgroup>
                <label for="receivable" class="col-sm-2 col-xs-2 control-label cursor-pointer text-right">将欠款从</label>
                <t:input readonly="true" path="receivable" colClass="col-sm-4 col-xs-4" />
                <label for="receipt" class="col-sm-2 col-xs-2 control-label cursor-pointer text-right">调整为</label>
                <t:input  onkeyup="return ValidateNumber(this,value)"  path="receipt" colClass="col-sm-4 col-xs-4" />
            </t:formgroup>
            <t:formgroup>
                <t:label path="comment" cssClass="col-sm-2 col-xs-2" />
                <t:input path="comment" colClass="col-sm-4 col-xs-4" />
            </t:formgroup>
        </t:form>
    </div>
    <t:panelFoot headingBtnCssClass="heading-btn pull-right-important">
		<t:button icon="icon-floppy-disk" onclick="saveData()" laddaType="progress" cssClass="btn-info" csize="sm">保存</t:button>
	</t:panelFoot>
</t:panel>

<script type="text/javascript">
$(function(){
	receiptChange();
});
function receiptChange(){
	$('#receipt').bind('input propertychange', function() {
		var price = parseFloat($(this).val());
		$(this).val(price)
		if(isNaN(price)){
			price = 0;
			$(this).val(0);
		}
		
	});
}


function saveData(){
	if($('#amount').val()==0){
		$.showTips("请填写调整金额！",1000,"warning");
		return;
	}
	if (!$("form:first").valid()){
		return;
	}
	$("form:first").submit();
}	

function actionResultCallBack(){
	var baseOperate={
			close:true,
			refresh:false
	}
	
	top.customer_form.customerRecordIframe.formSubmit();
	
	return baseOperate;
} 
</script>

<%@ include file="/WEB-INF/views/shared/base/scripts/jqueryui.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formtags.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formbuttons.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formpickers.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formselects.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formstyling.jsp"%>
<%@ include file="/WEB-INF/views/shared/master/dialog.jsp"%>
<%@ include file="/WEB-INF/views/shared/master/contentFooter.jsp"%>
